<template>
	<view class="becomeKoiNode">
		<navBar><template #title>申请成为锦鲤合伙人</template></navBar>
		<view class="secureCase">
			<view class="container">
				<text>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin
					gravida
					dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor.</text>
				<text>Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum,
					nulla
					luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan
					eget.Lorem
					ipsum dolor sit amet, consectetur adipiscing elit.</text>
				<text>Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo
					commodo.
					Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes,
					nascetur
					ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus
					pronin sapien nunc accuan eget.Lorem ipsum dolor sit amet, consectetur adipiscing elit.</text>
				<text>Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo
					commodo.
					Proin sodales pulvinar sic tempor.</text>
			</view>
			<view class="Tips" v-if="store.state.userInfo.vipLevel<10">
				您<text>没达到10星会员</text>或<text>未购买设备</text>
				无法申请成为黑金节点
			</view>
		</view>
		<view class="footerIn">
			<Footer>
				<template #btn>
					<van-button plain hairline type="primary" class="btn" @click="wantApply"
						:disabled='store.state.userInfo.vipLevel<10'>我要申请</van-button>
				</template>
			</Footer>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from 'vue'
	import { showSuccessToast, showFailToast } from 'vant'
	import navBar from '@/components/mine/navBar/index.vue'
	import Footer from '@/components/Home/footer/index.vue'
	import { koiNode } from '@/api/PendingOrderList'
	import store from '@/store/index'
	console.log(store)
	
	const wantApply = async () => {
		const result = await koiNode({})
		
		if (result.code === 200) {
			showSuccessToast(result.msg);
		} else {
			showFailToast(result.msg);
		}
	}
</script>

<style lang="scss" scoped>
	.becomeKoiNode {
		position: relative;
		min-height: 100vh;

		.container {
			padding: 40px;
			box-sizing: border-box;
			background: #2a2b2e;
			border-radius: 32px;
			color: #FFFFFF;
			font-weight: 400;
			font-family: PingFangSC, PingFang SC;
			font-size: 26px;

			uni-text {
				display: block;
				margin-bottom: 32px;

				&:last-child {
					margin-bottom: 0;
				}
			}
		}

		.Tips {
			width: 400px;
			height: 74px;
			margin: 100px auto;
			font-size: 26px;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #E02020;
			line-height: 37px;
			text-align: center;

			uni-text {
				text-decoration: underline;
			}
		}

		.footerIn {
			position: fixed;
			bottom: 0;
			width: 100%;
			height: 168px;
			background-color: #000000;
		}
	}
</style>